<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$课堂练习$</title>
</head>
<body>
<input type="text" value="" id="txt">
<script src="common.js"></script>
<script>
    my$("txt").onblur = function () {
        if (this.value.length >= 6 && this.value.length <= 10) {
            this.style.backgroundColor = "green";
        } else {
            this.style.backgroundColor = "red";

        }
    };
</script>
</body>
</html>